uint8_t buff[256]; // global block storage

uint8_t getch() {
  //while(!Serial.available());
  return Serial.read();
}

void readbytes(int n) {
  for (int x = 0; x < n; x++) {
    buff[x] = Serial.read();
  }
}

void serial(){
  byte r;
  uint8_t ch = getch();
  
  switch (ch) {
    
  case '0':
    pinMode(12, OUTPUT);
    digitalWrite(12, HIGH);
    delay(500);
    digitalWrite(12 , LOW);
    delay(500);
    digitalWrite(12, HIGH);
    delay(500);
    digitalWrite(12, LOW);
    delay(500);
    digitalWrite(12, HIGH);
    delay(500);
    digitalWrite(12, LOW);
    delay(500);  
    break;
    
  case '1':
    readbytes(3);
    r=buff[0];
    if(r == 64){
      Serial.println("OK!");
    }
    else{
      Serial.print("Nich Ok: ");
      Serial.println(r, DEC); }
    break;
    
  case '3':
    readbytes(3);
    for(int x=0;x<10;x++)
    {
       //LEDs[x].setColor(buff[0],buff[1],buff[2]);
    }
    
    Serial.print("Color: ");
    delay(10);
    Serial.print(buff[0], DEC);
    delay(10);
    Serial.print(" ");
    delay(10);
    Serial.print(buff[1], DEC);
    delay(10);
    Serial.print(" ");
    delay(10);
    Serial.println(buff[2], DEC);
    delay(10);
    break;
  }
}
